import request from '@/utils/request/index.js'
export default {
	
	//根据商品id获取商品
	getProductById(id){
		return request.request({
			url:'/h5/nocproduct/detail/'+ id,
			method:'get',
		});
	},
	//获取产品访问量
	getBrowseCount(id){
		return request.request({
			url:'/h5/nocproduct/browseCount/'+ id,
			method:'get',
		});
	},
	//获取推荐产品列表
	queryLikeProduct(limit,classId,tagIds){
		return request.request({
			url:'/h5/nocproduct/likeProlist',
			method:'post',
			data:{
				page:1,
				limit:limit,
				classId:classId,
				tagIds:tagIds,
			},
		});
	},
	/**收藏
	 * @param {Object} userId
	 * @param {Object} productId
	 */
	handleCollect(userId,productId){
		return request.request({
			url:'/h5/nocyxcollect/save',
			method:'post',
			data:{
				userId:userId,
				type:1,
				businessId:productId,
			},
		});
	},
	/**获取展会信息
	 * @param {Object} id
	 */
	getExhibitionInfo(id){
		console.log(id);
		return request.request({
			url: '/h5/nocuserexhibition/getExhibitionInfo',
			method : 'post',
			data:{
				userId : id 
			}
		})
	},
	/**产品详情页取消收藏
	 * @param {Object} collectionId
	 */
	cancelCollect(collectionId){
		return request.request({
			url:'/h5/nocyxcollect/cancelCollection',
			method:'post',
			data:{
				collectionId:collectionId,
			},
		});
	},
	/**获取产品信息
	 * @param {Object} userId
	 * @param {Object} productId
	 */
	getProductCollectInfo(userId,productId){

		return request.request({
			url:'/h5/nocyxcollect/getCollectInfoByProductId?businessId='+ productId + '&userId=' + userId + '&type=1',
			method:'get',
			data:{},
		});
	},
	/**获取厂家
	 * @param {Object} userId
	 */
	getVender(userId){
		return request.request({
			url:'/h5/nocuser/info/' + userId,
			method:'get',
			data:{},
		});
	},
	/**获取客服电话
	 * @param {Object} userId
	 */
	getServiceTelList(userId){
		return request.request({
			url:'/h5/userservicetel/getServiceTelByUserId/' + userId,
			method:'post',
			data:{},
		});
	},
	/**
	 * 获取产品样册
	 * @param {Object} samplebookId
	 */
	getSampleBook(samplebookId){
		return request.request({
			url: '/h5/nocsamplebook/info/' + samplebookId,
			method: 'get',
			data:{},
		})
	},
	/**
	 * 分享获取产品信息
	 * @param {Object} productId
	 */
	getProductInfo(productId){
		return request.request({
			url: '/h5/nocproduct/productInfoOfShare',
			method: 'post',
			data:{
				productId: productId
			},
		})
	},
	/**
	 * 分享获取产品商家信息
	 * @param {Object} userId
	 */
	getCompInfo(userId){
		return request.request({
			url: '/h5/noccloudhome/compInfoOfShare',
			method: 'post',
			data:{
				userId: userId
			},
		})
	}
	
	
	
}
